package pjkanri.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;

@Entity
public class Account implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	private Integer id;
	
//	@Column
	private String email;
	
//	@Column
	private String name;

//	@Column
	private String password;
	
	@Transient
	private Date loginDateTime;
	
//	@ManyToMany
//	@JoinTable(name="book_author", 
//		joinColumns=@JoinColumn(name="author_id"/*, referencedColumnName="id"*/), 
//		inverseJoinColumns=@JoinColumn(name="isbn"/*, referencedColumnName="isbn")*/))
//	private Set<Book> books;
	
	public Account() {}

	public Account(String email, String name) {
		super();
		this.email = email;
		this.name = name;
	}

	public Account(String email, String name, String password) {
		super();
		this.email = email;
		this.name = name;
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getLoginDateTime() {
		return loginDateTime;
	}

	
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	
	public void setLoginDateTime(Date loginDateTime) {
		this.loginDateTime = loginDateTime;
	}	
	
	@Override
	public String toString() {
		return "Author [id=" + id + ", name=" + name + ", email=" + email + " ]";
	}
}
